import huiji.Huiji;
import huiji.HuijiFrame;
import huiji.HuijiJPanel;

import javax.swing.*;
import java.io.File;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        jpannel();
        //new HuijiFrame().start();

                //System.out.println(Arrays.asList(new File("./").list()));
//
//                System.out.println(new File("./ddfdf.txt").exists());
//        //System.out.println( Main.class.getClassLoader().getResource("").getPath());
//        System.out.println(new File(ClassLoader.getSystemResource("qwe/qwe.txt").getPath()));
//                System.out.println(new File(ClassLoader.getSystemResource("qwe/qwe.txt").getPath()).exists());
    }

    public static void jpannel(){
        JFrame jFrame = new JFrame("飞机大战");
        HuijiJPanel huijiJPanel = new HuijiJPanel();
        jFrame.add(huijiJPanel);//添加面板
        jFrame.setSize(HuijiJPanel.width,HuijiJPanel.height);
        jFrame.setAlwaysOnTop(true);//设置窗口程序一直在系统顶部
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置关闭窗口自动停止进程
        jFrame.setLocationRelativeTo(null);//设置窗口的位置:居中
        jFrame.setVisible(true);//设置窗口是否可见,内部会去调用paint方法
        huijiJPanel.action();
    }
}
